﻿using System;
using System.Collections.Generic;
using System.Text;
using TestDataCreator;

namespace ConsoleApplication1
{
	class Program
	{
		static void Main(string[] args)
		{
			try
			{
				ILicenseNumberTester tester = new LicenseNumberTester();

				// test creation
				var b1 = tester.CreateDataFromFolder(@"D:\testdata", true, true);
				var list = tester.GetPathList(true);

				//test writing
				var b2 = tester.WriteData(@"D:\folder0\folder1\data.csv", true);
				var b3 = tester.WriteData(@"D:\testdata\data.csv", false);

				// test reading
				var b4 = tester.GetDataFromFile(@"D:\folder0\folder1\data.csv");

				// test cloning
				var data = tester.Clone();

				// test batch testing
				var value = tester.BatchTest(data);
				Console.WriteLine("batch: " + value.ToString());

				// test single changing
				int i = new Random().Next(data.Count);
				tester.EditLicenseNumber(i, "BH 5909 BA");

				var data2 = tester.Clone();
				var data3 = data2[i];

				data3.LicenseNumber = "BH 5909 BE";

				var value2 = tester.SingleTest(data3);

				Console.WriteLine("single: " + value2.ToString());

				// test two separete lists

				List<string> a = new List<string>();
				List<string> b = new List<string>();

				foreach (var item in data)
				{
					a.Add(item.ImagePath);
					b.Add(item.LicenseNumber);
				}

				var value3 = tester.BatchTest(a, b);

				Console.WriteLine("separate: " + value3.ToString());

				Console.WriteLine("short file name: " + data[0].GetFileName());

				foreach (var item in tester.da)
				{
					
				}

				System.Threading.Thread.SpinWait(100);					
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.Message);
			}

		/*	System.Uri uri1 = new Uri(@"C:\path0\file.txt");
			System.Uri uri2 = new Uri(@"C:\");
			Uri relativeUri = uri2.MakeRelativeUri(uri1);
			Console.WriteLine(relativeUri.ToString());
			Console.WriteLine(System.IO.Path.Combine(@"C:\path1\", relativeUri.ToString()));  */
		}
	}
}
